<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			#box{
				width:400px;
				height:400px;
				border:1px solid red;
			}
			#div1{
				width:100px;
				height:100px;
				background: blue;
			}
		</style>
		<script>
			window.onload = function(){
				var btn = document.getElementsByTagName('input')[0];
				btn.onclick = function(){
					var oBox = document.getElementById("box");
					var oDiv = oBox.children[0];
//					父节点                      要删的儿子节点
					oBox.removeChild(oDiv);
//					删掉后清除内存
					oDiv = null;
				}
			}
		</script>
	</head>
	<body>
		<input type="button" value="删除" />
		<div id="box">
			<div id="div1">我是要被干掉的</div>
		</div>
	</body>
</html>


































